const isTypeFuns = (function () {
  const objType = {
      "[object Array]": "array",
      "[object Object]": "object",
      "[object Number]": "number",
      "[object String]": "string",
      "[object Function]": "function",
    },
    toString = Object.prototype.toString;
  function isArray(val) {
    if (val === null) return "null";
    if (typeof val === "object" || typeof val === "function") {
      const objKey = toString.call(val);
      return objType[objKey];
    }
    return typeof val;
  }
  return {
    isArray: isArray,
  };
})();

console.log(isTypeFuns.isArray(() => {}));
console.log(isTypeFuns.isArray("1111"));
console.log(isTypeFuns.isArray(22222));
console.log(isTypeFuns.isArray({}));
console.log(isTypeFuns.isArray([]));
console.log(isTypeFuns.isArray(new Number()));
console.log(isTypeFuns.isArray(new String()));
console.log(isTypeFuns.isArray(new Function()));
console.log(isTypeFuns.isArray(undefined));
console.log(isTypeFuns.isArray(null));
